package com.xoa.controller.party;

import com.xoa.model.party.GridHoliday;
import com.xoa.service.party.GridHolidayService;
import com.xoa.util.ToJson;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Created by gsb on 2018/1/16.
 */
@Controller
@RequestMapping(value ="/gridHoliday")
public class GridHolidayController {

    @Resource
    private GridHolidayService gridHolidayService;

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-16 上午10:21:51
     * 类介绍  :   添加
     * 构造参数:
     *
     */
    @RequestMapping(value ="insert")
    @ResponseBody
    public ToJson<GridHoliday> insert(GridHoliday gridHoliday){
        return gridHolidayService.insert(gridHoliday);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-16 上午10:21:51
     * 类介绍  :   修改
     * 构造参数:
     *
     */
    @RequestMapping(value ="update")
    @ResponseBody
    public ToJson<GridHoliday> update(GridHoliday gridHoliday){
        return gridHolidayService.update(gridHoliday);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-16 上午10:21:51
     * 类介绍  :   删除
     * 构造参数:
     *
     */
    @RequestMapping(value ="deleteByPrimaryKey")
    @ResponseBody
    public ToJson<GridHoliday> deleteByPrimaryKey(Integer hid){
        return gridHolidayService.deleteByPrimaryKey(hid);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-16 上午10:21:51
     * 类介绍  :  详情
     * 构造参数:
     *
     */
    @RequestMapping(value ="selectByPrimaryKey")
    @ResponseBody
    public ToJson<GridHoliday> selectByPrimaryKey(Integer hid){
        return gridHolidayService.selectByPrimaryKey(hid);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-16 上午10:21:51
     * 类介绍  :  列表
     * 构造参数:
     *
     */
    @RequestMapping(value ="selectList")
    @ResponseBody
    public ToJson<GridHoliday> selectList(Integer page, Integer pageSize,
                                          boolean useFlag){
        return gridHolidayService.selectList(page, pageSize, useFlag);
    }
}
